package com.educate.ucenter.dao;

import com.educate.ucenter.dao.impl.FamilyDaoImpl;
import com.educate.ucenter.model.bo.FamilyBO;
import com.educate.ucenter.model.po.Family;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface FamilyDao extends MongoRepository<Family, String> {

    /**
     * #{@link FamilyDaoImpl#query(FamilyBO, Pageable)}
     */
    Page<Family> query(FamilyBO bo, Pageable pageable);

    Optional<Family> findByCreator(String userId);
}
